package com.elf.zero.step;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public abstract class StepDao {

    @Query("select * from StepData order by [date] desc")
    public abstract List<StepData> query();


    @Query("select * from StepData order by [date] desc limit :start,:end")
    public abstract List<StepData> queryLimit(int start, int end);

    @Query("select * from StepData where [date]=:date")
    public abstract StepData query(String date);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    public abstract long insert(StepData data);

    @Update
    public abstract int update(StepData data);
}
